package com.yuhs.zixing.pay.manager.merchant.impl;

import com.yuhs.zixing.pay.dal.merchant.dto.PayMerchantInfoDTO;
import com.yuhs.zixing.pay.dal.merchant.mapper.PayMerchantInfoMapper;
import com.yuhs.zixing.pay.manager.merchant.MerchantManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @ClassName MerchantManagerImpl
 * @Description 商户manager 实现类
 * @Author yuhs
 * @CreateDate 2020/12/4
 **/
@Slf4j
@Component
public class MerchantManagerImpl implements MerchantManager {


    @Resource
    PayMerchantInfoMapper payMerchantInfoMapper;


    /**
     * 通过商户号获取商户信息
     *
     * @param merchantNo 商户号
     * @return
     */
    @Override
    public PayMerchantInfoDTO getPayMerchantInfoByMerchantNo(String merchantNo) {
        return payMerchantInfoMapper.getPayMerchantInfoByMerchantNo(merchantNo);
    }

    /**
     * 商户添加
     *
     * @param payMerchantInfoDTO
     * @return
     */
    @Override
    public Boolean addMerchant(PayMerchantInfoDTO payMerchantInfoDTO) {
        return payMerchantInfoMapper.insert(payMerchantInfoDTO) > 0;
    }
}
